/**
 * 
 */
package masterlink.futures.dao;

import java.util.List;

import masterlink.futures.vo.EmpGroup;

import org.springframework.stereotype.Repository;

/**
 * @author tonyyang
 *
 */
@Repository
public class EmpGroupDao extends TimesTenHibernateDao<EmpGroup,EmpGroup.ID>{
	
	private static final String FIND_ALERT_GROUP="from EmpGroup where id.group.system='Y' and phone is not null and (send='Y' or send is null)";
	private static final String FIND_BY_EMP="from EmpGroup where id.empno=?";
	
	@SuppressWarnings("unchecked")
	public List<EmpGroup> findAlertGroup(){
		return (List<EmpGroup>) findByHql(FIND_ALERT_GROUP);
	}
	
	@SuppressWarnings("unchecked")
	public List<EmpGroup> findByEmp(String empno){
		return (List<EmpGroup>) findByHql(FIND_BY_EMP,empno);
	}
	
}
